<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="keywords" content=""/>
<meta name="description" content=""/>
<title></title> 
<style type="text/css">
@import "/css/page.css";


</style>

  <script src='/js/prototype.js'></script>
  <script src='/js/global.js'></script>
  <script type="text/javascript" src="<?=$_SERVER['config']['frontend']?>/js/common.js"></script>
  <script type="text/javascript" src="<?=$_SERVER['config']['frontend']?>/js/UBBCode.js"></script>
  <script type="text/javascript" src="<?=$_SERVER['config']['frontend']?>/js/UrlUtil.js"></script>
  <script type="text/javascript">
  
  function highlightRow(event){
  	event = $E(event);
  	var find = Event.element(event);

  	while(!(find.tagName.toUpperCase() == 'TR')){
  		find = $(find.parentNode);
  		if(find == null || find.tagName.toUpperCase() == 'BODY') break;
  	}
  	if(find.tagName.toUpperCase() == 'TR')
  		find.addClassName('highlight');
  	
  }
  
  function unhighlightRow(event){
  	event = $E(event);
  	var find = Event.element(event);

  	while(!(find.tagName.toUpperCase() == 'TR')){
  		find = $(find.parentNode);
  		if(find == null || find.tagName.toUpperCase() == 'BODY') break;
  	}
  	if(find.tagName.toUpperCase() == 'TR')
  		find.removeClassName('highlight');
  }
  
  function showDeleteConfirmBox(url){
  	var clientHeight = document.documentElement.clientHeight ;
	var clientWidth = document.documentElement.clientWidth;
	var width = $('box').getWidth();
	var height = $('box').getHeight();
	var top = (clientHeight - height)/2 + document.documentElement.scrollTop - (clientHeight - height)/2 * 0.3;
	var left = (clientWidth - width)/2;
  	$('boxForm').setAttribute("action", "/?"+url);
  	$('box').show();
  	$('box').setStyle({top: top + "px", left: left+"px"});
  	$('box_shadow').setStyle({left : 0, top: 0,
  		 width: document.documentElement.scrollWidth + "px", 
  		 height: document.documentElement.scrollHeight + "px",
  		 opacity: 0.5
  	});
  	$('box_shadow').show();
  }
  
  function hookDeleteConfirm(event){
  	event = $E(event);
  	var src = Event.element(event);
  	var url = hookDeleteConfirm.hook(src);
  	showDeleteConfirmBox(url);
  }
  </script>
</head>
	<body>
<div id='box_shadow' style="position: absolute; z-index:98; background-color: black; display: none"></div>
<div style="position: absolute; z-index:99; top:100px; left: 400px; width: 300px;  border: 3px double ; background-color: white; display:none" id='box'>
<form action="" method="post" id='boxForm'>
<div class="box-close" onclick='$("box").hide(); $("box_shadow").hide();'>x</div>
<div class="box-title">
确认删除
</div>
<div class="box-content">
<table border="0">
<tr>
<td>删除原因</td>
<td>
<select name="description" onchange='if(this.selectedIndex==1){$("box_more").show();}else{$("box_more").hide();}'>
<option>内容有违反国家法规法令的内容</option>
<option value="0">其他原因</option>
</select>
</td>
</tr>
<tr id="box_more" style="display:none">
<td>其他原因</td>
<td><textarea style="width: 100%" name="custom_description"></textarea></td>
</tr>
<tr>
<td colspan="2" align="right"><input type='submit' value='确认'> <input type='button' value='取消' onclick='$("box").hide(); $("box_shadow").hide();'></td>
</tr>
</table>
</div>
</form>
</div>

<ul class='nav'>
<li class='t'>用户名</li><li><?= AdminController::$login['nickname']?></li>
<li class='t'>EMAIL</li><li><?= AdminController::$login['email']?></li>
<li class='t'>UID</li><li><?= AdminController::$login['uid']?></li>
<li style='float: right'><a href="<?=self::_makeURL('admin','login','logout')?>">退出登录</a></li>
</ul><table class='wrap' width="100%">
	<tr>
	<td style='float:left; border-right: 1px solid #999' valign="top" width="130">
<?= admin_util_menu::gen($_SERVER['config']['admin']['menu'])?>
	</td>
	<td class='content' valign="top" align="left" width="100%" style='padding-left:10px'>
<? include($this->view) ?>
	</td>
	</tr>
</div>



<script type="text/javascript">
$$('.list').each(function(tag){
	$(tag).observe('mouseover', highlightRow);
	$(tag).observe('mouseout', unhighlightRow);
});
</script>

<script>
	$$('.submenu').each(function(m){ m.hide();});
	var cookies = getMenuCookie();
	$$('.switcher').each(function(s, index){
		if(cookies[index]){
			doToggleMenu(s, index);
		}
	});
	
	$$('.switcher').each(function(s){
		s.observe('click', toggleMenu);
	});
	
	function toggleMenu(event){
		event = $E(event);
		var src = Event.element(event);
		var index = $$(".switcher").indexOf(src);
		doToggleMenu(src, index);
	}
	
	function doToggleMenu(src, index){
		if(src.hasClassName('more')){
//			alert($(src.parentNode).nextSibling.tagName);
			$(src.parentNode.nextSibling).toggle();
			src.toggleClassName('expand').toggleClassName('collapse');
			setMenuCookie(index, src.hasClassName('collapse'));
		}
	}
	
	function getMenuCookie(){
		var cookie = GetCookie('__adminMenu');
		if(!cookie) {
			cookie = '';
		}
		var records = {};
		cookie.split(":").each(function(item){ var pair = item.split("|"); records[pair[0]] = pair[1];});
		return records;
	}
	
	function setMenuCookie(index, open){
		var records = getMenuCookie();
		records[index] = open;
		var cookie = [];
		$H(records).each(function(pair){ if(pair[1]){ cookie.push(pair[0] + "|" + "1");}});
		document.cookie = "__adminMenu=" + cookie.join(":");
	}
	
	$$('.delete-link').each(function(item){
		item.observe('click', hookDeleteConfirm);
	});
	
</script>
	</body>
</html>
